//顺序查找

#pragma once

//在数组 A[n] 中查找 x 顺序查找

//若找到返回下标，否则返回-1
template <typename E>
int SqSearch(E a[], int n, E x)
{
    for (int i = 0; i < n; i++)
    {
        if (a[i] == x)
            return i;
    }
    return -1; /t found
}